﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/POS.master" CodeFile="AddEditEmployee.aspx.cs" Inherits="HR_AddEditEmployee" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        textarea {
            resize: none;
        }
    </style>
     <script type="text/javascript">
        function clientItemSelected(source, eventArgs) {
            var id_textbox = '<%=hdfCity.ClientID%>';
            document.getElementById(id_textbox).value = eventArgs.get_value();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:ScriptManager runat="server" ID="ScriptManager1" />
    <div class="container">
        <div class="main-title">
            <label class="control-label" for="Title">Add / Edit Employee</label>
        </div>
        <div class="form-horizontal" id="divEmployeeWrapper">
            <div class="form-group">
                <label class="control-label col-sm-4" for="Name">Name :</label>
                <div class="col-sm-6">
                    <asp:TextBox id="txtEmpName" class="form-control" required="required" runat="server" placeholder="Employee Name" />
                    <asp:RequiredFieldValidator ErrorMessage="Enter Employee Name" ControlToValidate="txtEmpName" runat="server" />
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-4" for="Person">Cell No :</label>
                <div class="col-sm-6">
                    <asp:TextBox  id="txtCellNo" class="form-control" required="required" runat="server" placeholder="Cell No" />
                    <asp:RequiredFieldValidator ErrorMessage="Enter Cell No" ControlToValidate="txtCellNo" runat="server" />
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-4" for="Phone">City  :</label>
                <div class="col-sm-6">
                    <asp:TextBox id="txtCity" required="required" class="form-control" runat="server" placeholder="City" />
                    <asp:RequiredFieldValidator ErrorMessage="Enter City" ControlToValidate="txtCity" runat="server" ForeColor="Red" />
                    <cc1:AutoCompleteExtender ID="cityAutoExtender" TargetControlID="txtCity"  ServiceMethod="SearchCities" OnClientItemSelected="clientItemSelected"
                        runat="server" MinimumPrefixLength="2"  CompletionInterval="1000" EnableCaching="true" CompletionSetCount="10">
                    </cc1:AutoCompleteExtender>
                    <asp:HiddenField runat="server" ID="hdfCity" />
                   
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-4" for="Cell">Address :</label>
                <div class="col-sm-6">
                    <asp:TextBox TextMode="MultiLine" id="txtAddress" class="form-control" required="required" runat="server" placeholder="Address"
                         height="75px" width="99%" />
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-4" for="City">Company :</label>
                <div class="col-sm-6">
                    <asp:DropDownList ID="DDL_Company" CssClass="form-control" DataTextField="CompanyName" DataValueField="CompanyID" AutoPostBack="true" OnSelectedIndexChanged="DDL_Company_SelectedIndexChanged" runat="server"></asp:DropDownList>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-4" for="City">Branch :</label>
                <div class="col-sm-6">
                    <asp:DropDownList ID="DDL_Branch" CssClass="form-control" DataValueField="BranchId" OnSelectedIndexChanged="DDL_Branch_SelectedIndexChanged" AutoPostBack="true" DataTextField="BranchName"  runat="server"></asp:DropDownList>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-4" for="City">Department :</label>
                <div class="col-sm-6">
                    <asp:DropDownList ID="DDL_Department" DataValueField="Dept_Id" DataTextField="Dept_Name" CssClass="form-control" AutoPostBack="true" OnSelectedIndexChanged="DDL_Department_SelectedIndexChanged"  runat="server"></asp:DropDownList>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-4" for="Address">Sub Department :</label>
                <div class="col-sm-6">
                   
                    <asp:DropDownList ID="DDL_SubDepartment" DataTextField="SubDeptName" DataValueField="SubDeptId" CssClass="form-control"   runat="server"></asp:DropDownList>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-4 col-sm-8">
                    <asp:Button id="btnSave" runat="server" CssClass="btn btn-success" Text="Save" OnClick="btnSave_Click" />
                   
                </div>
            </div>
        </div>
    </div>
    
</asp:Content>

